Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: add --target-version CLI flags for migrate run/revert #2538

Merged
merged 4 commits into from
Jul 31, 2023
Merged

cli: add --target-version CLI flags for migrate run/revert #2538

merged 4 commits into from
Jul 31, 2023

Conversation

inahga
Copy link
Contributor

@inahga inahga commented Jun 10, 2023

Closes #2534. See issue for detailed description of the purpose.

Adds a --target-version flag for migrate {run,revert}, which tells the command to apply any number of migrations to get to the provided schema version. The CLI will provide feedback on any migrations that were skipped due to the flag.

I went ahead and setup a basic test harness and CI for the CLI, where none seemed to exist before (let me know if I'm mistaken). It is optional--I thought it might be helpful. If not, the commit can be dropped.

@abonander
Copy link
Collaborator

@inahga sorry for the delay looking at this but it looks like there's some merge conflicts that need to be resolved.

After some discussion with my coworkers, we thought about the behavior a bit more:

The behavior is now that for a run, if the provided version is too old, the CLI
will return with failure rather than being a no-op. This gives feedback to the
operator instead of being quiet.

It is still valid to up/downgrade to the latest version, this will still be a no-op
to allow for idempotency.
@inahga
Copy link
Contributor Author

inahga commented Jul 15, 2023

No worries. I've rebased on the latest main, should be ready again for review @abonander.

@abonander abonander merged commit 84f21e9 into launchbadge:main Jul 31, 2023
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support targeting a specific schema version for migrations
2 participants